home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / exthandler / nsIExternalHelperAppService.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  17KB  |  428 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIExternalHelperAppService.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIExternalHelperAppService_h__
  6. #define __gen_nsIExternalHelperAppService_h__
  7.  
  8.  
  9. #ifndef __gen_nsICancelable_h__
  10. #include "nsICancelable.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIURI; /* forward declaration */
  18.  
  19. class nsIRequest; /* forward declaration */
  20.  
  21. class nsIStreamListener; /* forward declaration */
  22.  
  23. class nsIFile; /* forward declaration */
  24.  
  25. class nsIMIMEInfo; /* forward declaration */
  26.  
  27. class nsIWebProgressListener2; /* forward declaration */
  28.  
  29. class nsIInterfaceRequestor; /* forward declaration */
  30.  
  31.  
  32. /* starting interface:    nsIExternalHelperAppService */
  33. #define NS_IEXTERNALHELPERAPPSERVICE_IID_STR "0ea90cf3-2dd9-470f-8f76-f141743c5678"
  34.  
  35. #define NS_IEXTERNALHELPERAPPSERVICE_IID \
  36.   {0x0ea90cf3, 0x2dd9, 0x470f, \
  37.     { 0x8f, 0x76, 0xf1, 0x41, 0x74, 0x3c, 0x56, 0x78 }}
  38.  
  39. /**
  40.  * The external helper app service is used for finding and launching
  41.  * platform specific external applications for a given mime content type.
  42.  */
  43. class NS_NO_VTABLE nsIExternalHelperAppService : public nsISupports {
  44.  public: 
  45.  
  46.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IEXTERNALHELPERAPPSERVICE_IID)
  47.  
  48.   /**
  49.    * Binds an external helper application to a stream listener. The caller
  50.    * should pump data into the returned stream listener. When the OnStopRequest
  51.    * is issued, the stream listener implementation will launch the helper app
  52.    * with this data.
  53.    * @param aMimeContentType The content type of the incoming data
  54.    * @param aRequest The request corresponding to the incoming data
  55.    * @param aWindowContext Use GetInterface to retrieve properties like the
  56.    *                       dom window or parent window...
  57.    *                       The service might need this in order to bring up dialogs.
  58.    * @return A nsIStreamListener which the caller should pump the data into.
  59.    */
  60.   /* nsIStreamListener doContent (in ACString aMimeContentType, in nsIRequest aRequest, in nsIInterfaceRequestor aWindowContext); */
  61.   NS_IMETHOD DoContent(const nsACString & aMimeContentType, nsIRequest *aRequest, nsIInterfaceRequestor *aWindowContext, nsIStreamListener **_retval) = 0;
  62.  
  63.   /**
  64.    * Returns true if data from a URL with this extension combination
  65.    * is to be decoded from aEncodingType prior to saving or passing
  66.    * off to helper apps, false otherwise.
  67.    */
  68.   /* boolean applyDecodingForExtension (in AUTF8String aExtension, in ACString aEncodingType); */
  69.   NS_IMETHOD ApplyDecodingForExtension(const nsACString & aExtension, const nsACString & aEncodingType, PRBool *_retval) = 0;
  70.  
  71. };
  72.  
  73. /* Use this macro when declaring classes that implement this interface. */
  74. #define NS_DECL_NSIEXTERNALHELPERAPPSERVICE \
  75.   NS_IMETHOD DoContent(const nsACString & aMimeContentType, nsIRequest *aRequest, nsIInterfaceRequestor *aWindowContext, nsIStreamListener **_retval); \
  76.   NS_IMETHOD ApplyDecodingForExtension(const nsACString & aExtension, const nsACString & aEncodingType, PRBool *_retval); 
  77.  
  78. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  79. #define NS_FORWARD_NSIEXTERNALHELPERAPPSERVICE(_to) \
  80.   NS_IMETHOD DoContent(const nsACString & aMimeContentType, nsIRequest *aRequest, nsIInterfaceRequestor *aWindowContext, nsIStreamListener **_retval) { return _to DoContent(aMimeContentType, aRequest, aWindowContext, _retval); } \
  81.   NS_IMETHOD ApplyDecodingForExtension(const nsACString & aExtension, const nsACString & aEncodingType, PRBool *_retval) { return _to ApplyDecodingForExtension(aExtension, aEncodingType, _retval); } 
  82.  
  83. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  84. #define NS_FORWARD_SAFE_NSIEXTERNALHELPERAPPSERVICE(_to) \
  85.   NS_IMETHOD DoContent(const nsACString & aMimeContentType, nsIRequest *aRequest, nsIInterfaceRequestor *aWindowContext, nsIStreamListener **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->DoContent(aMimeContentType, aRequest, aWindowContext, _retval); } \
  86.   NS_IMETHOD ApplyDecodingForExtension(const nsACString & aExtension, const nsACString & aEncodingType, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ApplyDecodingForExtension(aExtension, aEncodingType, _retval); } 
  87.  
  88. #if 0
  89. /* Use the code below as a template for the implementation class for this interface. */
  90.  
  91. /* Header file */
  92. class nsExternalHelperAppService : public nsIExternalHelperAppService
  93. {
  94. public:
  95.   NS_DECL_ISUPPORTS
  96.   NS_DECL_NSIEXTERNALHELPERAPPSERVICE
  97.  
  98.   nsExternalHelperAppService();
  99.  
  100. private:
  101.   ~nsExternalHelperAppService();
  102.  
  103. protected:
  104.   /* additional members */
  105. };
  106.  
  107. /* Implementation file */
  108. NS_IMPL_ISUPPORTS1(nsExternalHelperAppService, nsIExternalHelperAppService)
  109.  
  110. nsExternalHelperAppService::nsExternalHelperAppService()
  111. {
  112.   /* member initializers and constructor code */
  113. }
  114.  
  115. nsExternalHelperAppService::~nsExternalHelperAppService()
  116. {
  117.   /* destructor code */
  118. }
  119.  
  120. /* nsIStreamListener doContent (in ACString aMimeContentType, in nsIRequest aRequest, in nsIInterfaceRequestor aWindowContext); */
  121. NS_IMETHODIMP nsExternalHelperAppService::DoContent(const nsACString & aMimeContentType, nsIRequest *aRequest, nsIInterfaceRequestor *aWindowContext, nsIStreamListener **_retval)
  122. {
  123.     return NS_ERROR_NOT_IMPLEMENTED;
  124. }
  125.  
  126. /* boolean applyDecodingForExtension (in AUTF8String aExtension, in ACString aEncodingType); */
  127. NS_IMETHODIMP nsExternalHelperAppService::ApplyDecodingForExtension(const nsACString & aExtension, const nsACString & aEncodingType, PRBool *_retval)
  128. {
  129.     return NS_ERROR_NOT_IMPLEMENTED;
  130. }
  131.  
  132. /* End of implementation class template. */
  133. #endif
  134.  
  135.  
  136. /* starting interface:    nsPIExternalAppLauncher */
  137. #define NS_PIEXTERNALAPPLAUNCHER_IID_STR "d0b5d7d3-9565-403d-9fb5-e5089c4567c6"
  138.  
  139. #define NS_PIEXTERNALAPPLAUNCHER_IID \
  140.   {0xd0b5d7d3, 0x9565, 0x403d, \
  141.     { 0x9f, 0xb5, 0xe5, 0x08, 0x9c, 0x45, 0x67, 0xc6 }}
  142.  
  143. /**
  144.  * This is a private interface shared between external app handlers and the platform specific
  145.  * external helper app service
  146.  */
  147. class NS_NO_VTABLE nsPIExternalAppLauncher : public nsISupports {
  148.  public: 
  149.  
  150.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_PIEXTERNALAPPLAUNCHER_IID)
  151.  
  152.   /**
  153.    * mscott --> eventually I should move this into a new service so other
  154.    * consumers can add temporary files they want deleted on exit.
  155.    * @param aTemporaryFile A temporary file we should delete on exit.
  156.    */
  157.   /* void deleteTemporaryFileOnExit (in nsIFile aTemporaryFile); */
  158.   NS_IMETHOD DeleteTemporaryFileOnExit(nsIFile *aTemporaryFile) = 0;
  159.  
  160. };
  161.  
  162. /* Use this macro when declaring classes that implement this interface. */
  163. #define NS_DECL_NSPIEXTERNALAPPLAUNCHER \
  164.   NS_IMETHOD DeleteTemporaryFileOnExit(nsIFile *aTemporaryFile); 
  165.  
  166. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  167. #define NS_FORWARD_NSPIEXTERNALAPPLAUNCHER(_to) \
  168.   NS_IMETHOD DeleteTemporaryFileOnExit(nsIFile *aTemporaryFile) { return _to DeleteTemporaryFileOnExit(aTemporaryFile); } 
  169.  
  170. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  171. #define NS_FORWARD_SAFE_NSPIEXTERNALAPPLAUNCHER(_to) \
  172.   NS_IMETHOD DeleteTemporaryFileOnExit(nsIFile *aTemporaryFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteTemporaryFileOnExit(aTemporaryFile); } 
  173.  
  174. #if 0
  175. /* Use the code below as a template for the implementation class for this interface. */
  176.  
  177. /* Header file */
  178. class _MYCLASS_ : public nsPIExternalAppLauncher
  179. {
  180. public:
  181.   NS_DECL_ISUPPORTS
  182.   NS_DECL_NSPIEXTERNALAPPLAUNCHER
  183.  
  184.   _MYCLASS_();
  185.  
  186. private:
  187.   ~_MYCLASS_();
  188.  
  189. protected:
  190.   /* additional members */
  191. };
  192.  
  193. /* Implementation file */
  194. NS_IMPL_ISUPPORTS1(_MYCLASS_, nsPIExternalAppLauncher)
  195.  
  196. _MYCLASS_::_MYCLASS_()
  197. {
  198.   /* member initializers and constructor code */
  199. }
  200.  
  201. _MYCLASS_::~_MYCLASS_()
  202. {
  203.   /* destructor code */
  204. }
  205.  
  206. /* void deleteTemporaryFileOnExit (in nsIFile aTemporaryFile); */
  207. NS_IMETHODIMP _MYCLASS_::DeleteTemporaryFileOnExit(nsIFile *aTemporaryFile)
  208. {
  209.     return NS_ERROR_NOT_IMPLEMENTED;
  210. }
  211.  
  212. /* End of implementation class template. */
  213. #endif
  214.  
  215.  
  216. /* starting interface:    nsIHelperAppLauncher */
  217. #define NS_IHELPERAPPLAUNCHER_IID_STR "99a0882d-2ff9-4659-9952-9ac531ba5592"
  218.  
  219. #define NS_IHELPERAPPLAUNCHER_IID \
  220.   {0x99a0882d, 0x2ff9, 0x4659, \
  221.     { 0x99, 0x52, 0x9a, 0xc5, 0x31, 0xba, 0x55, 0x92 }}
  222.  
  223. /**
  224.  * A helper app launcher is a small object created to handle the launching
  225.  * of an external application.
  226.  *
  227.  * Note that cancelling the load via the nsICancelable interface will release
  228.  * the reference to the launcher dialog.
  229.  */
  230. class NS_NO_VTABLE nsIHelperAppLauncher : public nsICancelable {
  231.  public: 
  232.  
  233.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IHELPERAPPLAUNCHER_IID)
  234.  
  235.   /**
  236.    * The mime info object associated with the content type this helper app
  237.    * launcher is currently attempting to load
  238.    */
  239.   /* readonly attribute nsIMIMEInfo MIMEInfo; */
  240.   NS_IMETHOD GetMIMEInfo(nsIMIMEInfo * *aMIMEInfo) = 0;
  241.  
  242.   /**
  243.    * The source uri
  244.    */
  245.   /* readonly attribute nsIURI source; */
  246.   NS_IMETHOD GetSource(nsIURI * *aSource) = 0;
  247.  
  248.   /**
  249.    * The suggested name for this file
  250.    */
  251.   /* readonly attribute AString suggestedFileName; */
  252.   NS_IMETHOD GetSuggestedFileName(nsAString & aSuggestedFileName) = 0;
  253.  
  254.   /**
  255.    * Called when we want to just save the content to a particular file.
  256.    * NOTE: This will release the reference to the nsIHelperAppLauncherDialog.
  257.    * @param aNewFileLocation Location where the content should be saved
  258.    */
  259.   /* void saveToDisk (in nsIFile aNewFileLocation, in boolean aRememberThisPreference); */
  260.   NS_IMETHOD SaveToDisk(nsIFile *aNewFileLocation, PRBool aRememberThisPreference) = 0;
  261.  
  262.   /**
  263.    * Use aApplication to launch with this content.
  264.    * NOTE: This will release the reference to the nsIHelperAppLauncherDialog.
  265.    * @param aApplication nsIFile corresponding to the location of the application to use.
  266.    * @param aRememberThisPreference TRUE if we should remember this choice.
  267.    */
  268.   /* void launchWithApplication (in nsIFile aApplication, in boolean aRememberThisPreference); */
  269.   NS_IMETHOD LaunchWithApplication(nsIFile *aApplication, PRBool aRememberThisPreference) = 0;
  270.  
  271.   /**
  272.    * The following methods are used by the progress dialog to get or set
  273.    * information on the current helper app launcher download.
  274.    * This reference will be released when the download is finished (after the
  275.    * listener receives the STATE_STOP notification).
  276.    */
  277.   /* void setWebProgressListener (in nsIWebProgressListener2 aWebProgressListener); */
  278.   NS_IMETHOD SetWebProgressListener(nsIWebProgressListener2 *aWebProgressListener) = 0;
  279.  
  280.   /**
  281.    * when the stand alone progress window actually closes, it calls this method
  282.    * so we can release any local state...
  283.    */
  284.   /* void closeProgressWindow (); */
  285.   NS_IMETHOD CloseProgressWindow(void) = 0;
  286.  
  287.   /**
  288.    * The file we are saving to
  289.    */
  290.   /* readonly attribute nsIFile targetFile; */
  291.   NS_IMETHOD GetTargetFile(nsIFile * *aTargetFile) = 0;
  292.  
  293.   /**
  294.    * Time when the download started
  295.    */
  296.   /* readonly attribute PRTime timeDownloadStarted; */
  297.   NS_IMETHOD GetTimeDownloadStarted(PRTime *aTimeDownloadStarted) = 0;
  298.  
  299. };
  300.  
  301. /* Use this macro when declaring classes that implement this interface. */
  302. #define NS_DECL_NSIHELPERAPPLAUNCHER \
  303.   NS_IMETHOD GetMIMEInfo(nsIMIMEInfo * *aMIMEInfo); \
  304.   NS_IMETHOD GetSource(nsIURI * *aSource); \
  305.   NS_IMETHOD GetSuggestedFileName(nsAString & aSuggestedFileName); \
  306.   NS_IMETHOD SaveToDisk(nsIFile *aNewFileLocation, PRBool aRememberThisPreference); \
  307.   NS_IMETHOD LaunchWithApplication(nsIFile *aApplication, PRBool aRememberThisPreference); \
  308.   NS_IMETHOD SetWebProgressListener(nsIWebProgressListener2 *aWebProgressListener); \
  309.   NS_IMETHOD CloseProgressWindow(void); \
  310.   NS_IMETHOD GetTargetFile(nsIFile * *aTargetFile); \
  311.   NS_IMETHOD GetTimeDownloadStarted(PRTime *aTimeDownloadStarted); 
  312.  
  313. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  314. #define NS_FORWARD_NSIHELPERAPPLAUNCHER(_to) \
  315.   NS_IMETHOD GetMIMEInfo(nsIMIMEInfo * *aMIMEInfo) { return _to GetMIMEInfo(aMIMEInfo); } \
  316.   NS_IMETHOD GetSource(nsIURI * *aSource) { return _to GetSource(aSource); } \
  317.   NS_IMETHOD GetSuggestedFileName(nsAString & aSuggestedFileName) { return _to GetSuggestedFileName(aSuggestedFileName); } \
  318.   NS_IMETHOD SaveToDisk(nsIFile *aNewFileLocation, PRBool aRememberThisPreference) { return _to SaveToDisk(aNewFileLocation, aRememberThisPreference); } \
  319.   NS_IMETHOD LaunchWithApplication(nsIFile *aApplication, PRBool aRememberThisPreference) { return _to LaunchWithApplication(aApplication, aRememberThisPreference); } \
  320.   NS_IMETHOD SetWebProgressListener(nsIWebProgressListener2 *aWebProgressListener) { return _to SetWebProgressListener(aWebProgressListener); } \
  321.   NS_IMETHOD CloseProgressWindow(void) { return _to CloseProgressWindow(); } \
  322.   NS_IMETHOD GetTargetFile(nsIFile * *aTargetFile) { return _to GetTargetFile(aTargetFile); } \
  323.   NS_IMETHOD GetTimeDownloadStarted(PRTime *aTimeDownloadStarted) { return _to GetTimeDownloadStarted(aTimeDownloadStarted); } 
  324.  
  325. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  326. #define NS_FORWARD_SAFE_NSIHELPERAPPLAUNCHER(_to) \
  327.   NS_IMETHOD GetMIMEInfo(nsIMIMEInfo * *aMIMEInfo) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMIMEInfo(aMIMEInfo); } \
  328.   NS_IMETHOD GetSource(nsIURI * *aSource) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSource(aSource); } \
  329.   NS_IMETHOD GetSuggestedFileName(nsAString & aSuggestedFileName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSuggestedFileName(aSuggestedFileName); } \
  330.   NS_IMETHOD SaveToDisk(nsIFile *aNewFileLocation, PRBool aRememberThisPreference) { return !_to ? NS_ERROR_NULL_POINTER : _to->SaveToDisk(aNewFileLocation, aRememberThisPreference); } \
  331.   NS_IMETHOD LaunchWithApplication(nsIFile *aApplication, PRBool aRememberThisPreference) { return !_to ? NS_ERROR_NULL_POINTER : _to->LaunchWithApplication(aApplication, aRememberThisPreference); } \
  332.   NS_IMETHOD SetWebProgressListener(nsIWebProgressListener2 *aWebProgressListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetWebProgressListener(aWebProgressListener); } \
  333.   NS_IMETHOD CloseProgressWindow(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CloseProgressWindow(); } \
  334.   NS_IMETHOD GetTargetFile(nsIFile * *aTargetFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTargetFile(aTargetFile); } \
  335.   NS_IMETHOD GetTimeDownloadStarted(PRTime *aTimeDownloadStarted) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTimeDownloadStarted(aTimeDownloadStarted); } 
  336.  
  337. #if 0
  338. /* Use the code below as a template for the implementation class for this interface. */
  339.  
  340. /* Header file */
  341. class nsHelperAppLauncher : public nsIHelperAppLauncher
  342. {
  343. public:
  344.   NS_DECL_ISUPPORTS
  345.   NS_DECL_NSIHELPERAPPLAUNCHER
  346.  
  347.   nsHelperAppLauncher();
  348.  
  349. private:
  350.   ~nsHelperAppLauncher();
  351.  
  352. protected:
  353.   /* additional members */
  354. };
  355.  
  356. /* Implementation file */
  357. NS_IMPL_ISUPPORTS1(nsHelperAppLauncher, nsIHelperAppLauncher)
  358.  
  359. nsHelperAppLauncher::nsHelperAppLauncher()
  360. {
  361.   /* member initializers and constructor code */
  362. }
  363.  
  364. nsHelperAppLauncher::~nsHelperAppLauncher()
  365. {
  366.   /* destructor code */
  367. }
  368.  
  369. /* readonly attribute nsIMIMEInfo MIMEInfo; */
  370. NS_IMETHODIMP nsHelperAppLauncher::GetMIMEInfo(nsIMIMEInfo * *aMIMEInfo)
  371. {
  372.     return NS_ERROR_NOT_IMPLEMENTED;
  373. }
  374.  
  375. /* readonly attribute nsIURI source; */
  376. NS_IMETHODIMP nsHelperAppLauncher::GetSource(nsIURI * *aSource)
  377. {
  378.     return NS_ERROR_NOT_IMPLEMENTED;
  379. }
  380.  
  381. /* readonly attribute AString suggestedFileName; */
  382. NS_IMETHODIMP nsHelperAppLauncher::GetSuggestedFileName(nsAString & aSuggestedFileName)
  383. {
  384.     return NS_ERROR_NOT_IMPLEMENTED;
  385. }
  386.  
  387. /* void saveToDisk (in nsIFile aNewFileLocation, in boolean aRememberThisPreference); */
  388. NS_IMETHODIMP nsHelperAppLauncher::SaveToDisk(nsIFile *aNewFileLocation, PRBool aRememberThisPreference)
  389. {
  390.     return NS_ERROR_NOT_IMPLEMENTED;
  391. }
  392.  
  393. /* void launchWithApplication (in nsIFile aApplication, in boolean aRememberThisPreference); */
  394. NS_IMETHODIMP nsHelperAppLauncher::LaunchWithApplication(nsIFile *aApplication, PRBool aRememberThisPreference)
  395. {
  396.     return NS_ERROR_NOT_IMPLEMENTED;
  397. }
  398.  
  399. /* void setWebProgressListener (in nsIWebProgressListener2 aWebProgressListener); */
  400. NS_IMETHODIMP nsHelperAppLauncher::SetWebProgressListener(nsIWebProgressListener2 *aWebProgressListener)
  401. {
  402.     return NS_ERROR_NOT_IMPLEMENTED;
  403. }
  404.  
  405. /* void closeProgressWindow (); */
  406. NS_IMETHODIMP nsHelperAppLauncher::CloseProgressWindow()
  407. {
  408.     return NS_ERROR_NOT_IMPLEMENTED;
  409. }
  410.  
  411. /* readonly attribute nsIFile targetFile; */
  412. NS_IMETHODIMP nsHelperAppLauncher::GetTargetFile(nsIFile * *aTargetFile)
  413. {
  414.     return NS_ERROR_NOT_IMPLEMENTED;
  415. }
  416.  
  417. /* readonly attribute PRTime timeDownloadStarted; */
  418. NS_IMETHODIMP nsHelperAppLauncher::GetTimeDownloadStarted(PRTime *aTimeDownloadStarted)
  419. {
  420.     return NS_ERROR_NOT_IMPLEMENTED;
  421. }
  422.  
  423. /* End of implementation class template. */
  424. #endif
  425.  
  426.  
  427. #endif /* __gen_nsIExternalHelperAppService_h__ */
  428.